#!/bin/sh

# $Id: initramfs.cfg,v 1.7 2009-08-11 00:53:39 brian Exp $
# Copyright (c)2009 Brian Manning
# elspicyjack (at) gmail dot com
# PLEASE DO NOT E-MAIL THE AUTHOR ABOUT THIS SOFTWARE
# The proper venue for questions is the Antlinux mailing list at:
# http://groups.google.com/group/antlinux or <antlinux@googlegroups.com>

# License: GPL v2 (see licence blurb at the bottom of the file)

# this is a simple script that has nothing but shell variables; this file is
# sourced by make_initramfs.sh in order to set up the build environment for
# making an initramfs image
INITRAMFS_CFG_VERSION=2
#KERNEL_VER="3.0.1-lack"
KERNEL_VER="3.6.9-lack"
PROJECT_NAME="lack"
# for the issue file
RELEASE_DATE=$(/bin/date +%d%b%Y)
RELEASE_VER="2012.4 (${RELEASE_DATE})"
LACK_PASS="dawson32nd"

# export some stuff so other scripts can use it
export KERNEL_VER PROJECT_NAME RELEASE_DATE RELEASE_VER LACK_PASS

RECIPES='
    _basedirs _baselibs.squeeze udev.squeeze
    debug-tools lspci.squeeze usbutils lshw libstdc++.squeeze
    pam.squeeze pam.locales
    lsb-base openssl wget mount-tools.squeeze
    reiserfs jfs xfs e2fsprogs extfs-common lvm2.squeeze
    run-parts ifupdown dhclient thttpd stunnel4 sudo
    ncursesw.squeeze dialog.squeeze shellinabox
    libasound.squeeze aumix alsa-utils.squeeze
    perl-base.squeeze perl-cgi.squeeze
' # RECIPES


# a list of files that will be mangled prior to being stuffed into $TEMP_DIR
INPUT_FILES="etcfiles/issue.${PROJECT_NAME}
isolinux/${PROJECT_NAME}.banner.txt
" # INPUT_FILES

    # source the common build functions (used below)
    echo "- Sourcing common_release_functions located in ${BUILD_BASE}/scripts"
    source $BUILD_BASE/scripts/common_release_functions.sh

    # from make_initramfs.sh; sets OUTPUT_FILENAME
    if [ "x${LACK_WORK_DIR}" = "x" ]; then
        export LACK_WORK_DIR="/tmp"
    fi
    find_first_free_filename $LACK_WORK_DIR \
        "initramfs-${PROJECT_NAME}-${KERNEL_VER}"

    # check the project filelist has been set by make_initramfs.sh
    check_empty_envvar "PROJECT_LIST" $PROJECT_LIST
    check_exit_status $? "PROJECT_LIST environment variable"
    # check the temp directory has been set by make_initramfs.sh
    check_empty_envvar "TEMP_DIR" $TEMP_DIR
    check_exit_status $? "TEMP_DIR environment variable"
    # check that the *.base.txt file exists for this project
    check_base_file_exists
    check_exit_status $? "${PROJECT_DIR}/${PROJECT_NAME}.base.txt file exists"
    # create the project filelist
    create_project_filelist
    check_exit_status $? "Create project filelist"
    # create the hostname file, put it in the temp dir
    create_hostname_file
    check_exit_status $? "Creating hostname file"
    # we want a standalone init script for pigwidgeon
    create_init_initramfs_script
    check_exit_status $? "Creating initramfs init script"
    # copy the LACK SSL PEM file for shellinabox
    copy_lack_ssl_pem_file
    check_exit_status $? "Copying LACK SSL PEM key/cert file"
    # copy the busybox binary
    copy_busybox_binary
    check_exit_status $? "Copying busybox binary"
    # run INPUT_FILES through a sed filter
    sedify_input_files $INPUT_FILES
    check_exit_status $? "Applying 'sed' filters to input files"

# *begin licence blurb*
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA  02111-1307 USA

# vi: set sw=4 ts=4 ft=sh:
# fin!
